//
//  WBDemoViewController.swift
//  传智微博
//
//  Created by zhoujiming on 2016/12/24.
//  Copyright © 2016年 gmcc. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    
    // 继续push一个控制器
    @objc fileprivate func showNext(){
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
    
}


extension WBDemoViewController{
    override func setupTableView() {
        super.setupTableView()
        
        //        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
    }
